//
//  LJLRecommendedTVC.m
//  聆听FM
//
//  Created by dllo on 16/6/13.
//  Copyright © 2016年 Dark. All rights reserved.
//

#import "LJLRecommendedTVC.h"
#import "UIImageView+WebCache.h"
@implementation LJLRecommendedTVC

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.leftIV = [[UIImageView alloc] init];
        [self.contentView addSubview:_leftIV];
        self.titleL = [[UILabel alloc] init];
        self.titleL.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleL];
        self.reasonL = [[UILabel alloc] init];
        self.reasonL.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_reasonL];
        self.personL = [[UILabel alloc] init];
        self.personL.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_personL];
        self.tracksL = [[UILabel alloc] init];
        self.tracksL.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:_tracksL];

    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.leftIV.frame = CGRectMake(10, 10, 80, 80);
    self.titleL.frame = CGRectMake(100, 10, 225, 30);
    self.reasonL.frame = CGRectMake(100, 40, 175, 25);
    self.personL.frame = CGRectMake(100, 65, 80, 25);
    self.tracksL.frame = CGRectMake(180, 65, 50, 25);
}
- (void)setModel:(LJLRecommendedModel *)model
{
    if (_model != model) {
        _model = model;
        
        [self.leftIV sd_setImageWithURL:[NSURL URLWithString:model.coverLarge] placeholderImage:[UIImage sd_animatedGIFNamed:@"占位图"]];
        self.titleL.text = model.title;
        self.reasonL.text = model.recReason;
        self.personL.text = [NSString stringWithFormat:@"%.1f万人", model.lastUptrackId / 10000.0];
        self.tracksL.text = [NSString stringWithFormat:@"%ld集", model.tracks];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
